﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using MinhTuan;
namespace Products
{
    public class Class
    {
        #region // attribute
            private Int32 _Class_Id;
            private String _Class_Name;
            private String _Class_Title;
            private Int32 _Class_Sort;
            private Boolean _IsActive;
        #endregion
        #region //initialize
                    public Class()
                    {

                    }
                    public Class(
			            Int32 Class_Id,
			            String Class_Name,
			            String Class_Title,
			            Int32 Class_Sort,
			            Boolean IsActive
                        )
                    {		_Class_Id=Class_Id;
		            _Class_Name=Class_Name;
		            _Class_Title=Class_Title;
		            _Class_Sort=Class_Sort;
		            _IsActive=IsActive;
                    }
                   
        	        public Int32 Class_Id
	                {
	                  get { return _Class_Id; }
	                  set { _Class_Id = value; }
	                 }

    	            public String Class_Name
	                {
	                  get { return _Class_Name; }
	                  set { _Class_Name = value; }
	                 }

	                public String Class_Title
	                {
	                  get { return _Class_Title; }
	                  set { _Class_Title = value; }
	                 }

	                public Int32 Class_Sort
	                {
	                  get { return _Class_Sort; }
	                  set { _Class_Sort = value; }
	                 }

	                public Boolean IsActive
	                {
	                  get { return _IsActive; }
	                  set { _IsActive = value; }
	                 }

        #endregion
        #region //Method

                    public static DataTable GetClass()
                    {
                        DataTable tbl = new DataTable();
                        try
                        {
                            Access.InitAccess();
                            Access.mySqlCommand.CommandText = "sp_Products_GetClass";
                            DataSet ds = new DataSet();
                            SqlDataAdapter da = new SqlDataAdapter(Access.mySqlCommand);
                            da.Fill(ds);
                            tbl = ds.Tables[0];
                            Access.ClosedAccess();
                            return tbl;

                        }
                        catch
                        {
                            Access.ClosedAccess();
                            return tbl;
                        }

                    }
        #endregion
    }
}
